#include<bits/stdc++.h>
using namespace std;
struct pieces {
	int h, w;
};
int main()
{
	int N, K;
	cin >> N >> K;
//	int minpiece = INT_MAX;// WA 用最小面积 WA 最小值初值赋值 WA 不能优化
	vector<pieces> chocolates(N);
	for (int i = 0; i < N; i++) {
		cin >> chocolates[i].h >> chocolates[i].w;
//		minpiece = min(minpiece, chocolates[i].h * chocolates[i].w);
	}

	int left = 1;
	int right = 1e5;
	int res = 0;
	while (left <= right) {
		int mid = left + (right - left) / 2;
		int cnt = 0;
		for (int i = 0; i < N; i++) {
			int cntH = chocolates[i].h / mid;
			int cntW = chocolates[i].w / mid;
			cnt += cntH * cntW;
		}
		// 够分就出
		// WA 二分条件写反了， 当数量多于K时，应该继续增大
		if (cnt >= K) {
			res = mid;
			left = mid + 1;
		} else {
			right = mid - 1;	
		}
	}
	cout << res << endl;
	return 0;
}

